#ifndef QHierarchyFactory_P_H
#define QHierarchyFactory_P_H

#include <QMutex>

#include "QRemoteObject2.h"

typedef std::shared_ptr<QRemoteObject2::HierarchyInterfaceFactory> HierarchyInterfaceFactoryPtr;
typedef std::shared_ptr<QRemoteObject2::HierarchyInterface> HierarchyInterfacePtr;

class QHierarchtFactoryManager
{
public:
    static QHierarchtFactoryManager* Instance();

    void registerHierarchyFactory(const char* className,QRemoteObject2::HierarchyInterfaceFactory* factory);
    QRemoteObject2::HierarchyInterfaceFactory* getHierarchyFactory(const char* className);
    QRemoteObject2::HierarchyInterfaceFactory* findHierarchyFactory(const QMetaObject* meta);

private:
    QMap<QString,HierarchyInterfaceFactoryPtr> m_HierarchyInterfaceFactorys;
    QMutex m_HierarchyInterfaceFactoryMutex;
};
#endif
